package com.gzhryc.shared_device.iot.code.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.iot.code.IIOTLogEntity;
import com.gzhryc.shared_device.iot.code.dao.enums.ELogType;

import java.util.Date;

@Table(name="iot_logs_record")
public class IOTLogsRecord implements IIOTLogEntity {

    private static final long serialVersionUID = 1L;

	@Id
    protected Long id;

    @Column(name = "iot_id", notNull = true, note = "IOT节点")
    protected Long iotId;

    @Column(name = "msg_id", length = 32)
    protected String msgId;

    @Column(name = "iot_topic", notNull = true, length = 255)
    protected String iotTopic;

    @Column(name = "type", notNull = true)
    protected String type;

    @Column(name = "device_sn", notNull = true, length = 32)
    protected String deviceSn;

    @Column(name = "command")
    protected String command;

    @Column(name = "content", type="TEXT")
    protected String content;

    @Column(name = "protocol_type", notNull = true)
    protected String protocolType;

    @Column(name = "create_date", notNull = true)
    protected Date createDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getIotId() {
        return iotId;
    }

    public void setIotId(Long iotId) {
        this.iotId = iotId;
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getIotTopic() {
        return iotTopic;
    }

    public void setIotTopic(String iotTopic) {
        this.iotTopic = iotTopic;
    }

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getProtocolType() {
        return protocolType;
    }

    public void setProtocolType(String protocolType) {
        this.protocolType = protocolType;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getTypeName(){
        return ELogType.note(this.type);
    }
}
